package com.threadmethod.produerstack;

/**
 * @PackageName:com.threadmethod.produerstack
 * @ClassName:Test01
 * @Description: 测试一生产多消费的情况
 * @Author: zhangxiaoyu
 * @date 2021/1/18 14:56
 */
public class Test01 {
    
    public static void main(String[] args){
        MyStack stack = new MyStack();

        ProducerThread p = new ProducerThread(stack);

        ConsumerThread c1 = new ConsumerThread(stack);
        ConsumerThread c2 = new ConsumerThread(stack);
        ConsumerThread c3 = new ConsumerThread(stack);

        c1.setName("消费者1号");
        c2.setName("消费者2号");
        c3.setName("消费者3号");

        p.start();
        c1.start();
        c2.start();
        c3.start();
    }
}
